%% Author: vjache
%% Created: 16.09.2009
%% Description: TODO: Add description to context_example
-module(context_example).

%%
%% Include files
%%

%%
%% Exported Functions
%%
-export([]).

-record(bean,
		{id,lifecycle,depends,create}).
-record(handle,
		{id,scope,impl_module,init}).
-record(server,
		{module,start_fun,start_arg_list}).

%%
%% API Functions
%%
beans() ->
	#bean{
		  id=ospg,
		  lifecycle=singleton,
		  depends=[spog],
		  create=fun(SpogHandle)->
						 OspgHandle={map_ets,map_ets:new(ospg)},
						 map:add_listener(SpogHandle,OspgHandle),
						 OspgHandle
				 end
		 }.

servers()->
	{ofo,
	 [
	  #server{
			  module=map_ets_srv,
			  start_fun=start_link,
			  start_arg_list=[]}
	  ]}.

main(Key) ->
	M=erlioc:get(default, map_mem),{Impl,State}=M,
	map:get(M,Key).

